﻿using System.Collections.Generic;
using System.Web.UI;
using viNews.Classes;
using viNews.Controllers;
using visinia.SmartEngine;
using visinia.SmartEngine.Modules;

public partial class Modules_viNews_TopStories : WebModule
{
    protected override void WebModuleRender(HtmlTextWriter output)
    {
        List<News> list = DataFilterController.GetFilteredData(ModuleId);
        if (list == null)
            return;
        List<string> text = new List<string>();
        List<string> links = new List<string>();
        foreach (News news in list)
        {
            text.Add(news.Title);
            links.Add(news.Url);
        }        
        string data = WebHelpers.GenerateBulletedListHyperLinks(text.ToArray(), links.ToArray());
        output.Write(data);
    }
}
